import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:sp_util/sp_util.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBProjectPopPage/YBWorkTaiInfoShowVipPage.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBWorkTaiModule/YBWorkTaiSubPage/yb_worktai_zhuanshu_yingyong_type.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBUtils/YBBaseUtils/YBisLoginUtils.dart';

import 'YBWorkTaiSubImageTitlePage.dart';

class YBWorkTaiZhuanShuYingYongPage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Container(
      child:Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Container(
            child: InkWell(
              child: YBWorkTaiSubImageTitlePage(imageStr: "worktaiyijitong",titleStr: YBChineseText.workTaiZhuanShuYingYongYiJiTongTitle,widthValue:YBTextStyle.adapterSize44,heightValue: YBTextStyle.adapterSize44,textStyleInfo: YBTextStyle.workTaiSubTitleText,),
              onTap: (){
                if(YBisLoginUtils.isLogin() == true){
                  if (YBisLoginUtils.isStore() == true){
                    if (SpUtil.getString('mishuTYpe_yijitong') != null) {
                      if (SpUtil.getString('mishuTYpe_yijitong').contains("1")) {
                        YBNavigatorUtil.jump(context, '/workTaiPage/workTaiYiJiTongPage');
                      }else {
                        YBNavigatorUtil.jump(
                            context, '/workTaiPage/workTaiMiShuGeneralPage?type=1');
                      }
                    }else {
                      YBNavigatorUtil.jump(
                          context, '/workTaiPage/workTaiMiShuGeneralPage?type=1');
                    }
                  } else {
                     YBWorkTaiInfoShowVipPage.showWorkTaiInfoVipPage(context,titleStr: YBChineseText.workTaiZhuangShuYiJiTongToastInfo);
                  }
                }else{
                  YBApplication.router.navigateTo(context, '/loginIn');
                }
              },
            ),
          ),
          Container(
            child: InkWell(
              child: YBWorkTaiSubImageTitlePage(imageStr: "worktailvsitong",titleStr: YBChineseText.workTaiZhuanShuYingYongLvSiTongTitle,widthValue:YBTextStyle.adapterSize44,heightValue: YBTextStyle.adapterSize44,textStyleInfo: YBTextStyle.workTaiSubTitleText,),
              onTap: (){
                if(YBisLoginUtils.isLogin() == true){
                  if (YBisLoginUtils.isLawyer() == true){
                    if (SpUtil.getString('mishuTYpe_lvsitong') != null) {
                      if (SpUtil.getString('mishuTYpe_lvsitong').contains("1")) {
                        YBNavigatorUtil.jump(context, '/workTaiPage/workTaiLvSiTongPage');
                      } else {
                        YBNavigatorUtil.jump(
                            context, '/workTaiPage/workTaiMiShuGeneralPage?type=2');
                      }
                    } else{
                      YBNavigatorUtil.jump(
                          context, '/workTaiPage/workTaiMiShuGeneralPage?type=2');
                    }
                  }else{
                    YBWorkTaiInfoShowVipPage.showWorkTaiInfoVipPage(context,titleStr: YBChineseText.workTaiZhuangShuLvSiTongToastInfo);
                  }
                }else{
                  YBApplication.router.navigateTo(context, '/loginIn');
                }
              },
            ),
          ),
          Container(
            child: InkWell(
              child: YBWorkTaiSubImageTitlePage(imageStr: "worktaimishutong",titleStr: YBChineseText.workTaiZhuanShuYingYongMiShuTongTitle,widthValue:YBTextStyle.adapterSize44,heightValue: YBTextStyle.adapterSize44,textStyleInfo: YBTextStyle.workTaiSubTitleText,),
              onTap: (){
                if(YBisLoginUtils.isLogin() == true){
                  if (YBisLoginUtils.isMiShuTong() == true){
                    if (SpUtil.getString('mishuTYpe_mishutong') != null) {
                      if (SpUtil.getString('mishuTYpe_mishutong').contains("1")) {
                        YBNavigatorUtil.jump(context, '/workTaiPage/workTaiMiShuTongPage');
                      }else {
                        YBNavigatorUtil.jump(
                            context, '/workTaiPage/workTaiMiShuGeneralPage?type=3');
                      }
                    }else{
                      YBNavigatorUtil.jump(
                          context, '/workTaiPage/workTaiMiShuGeneralPage?type=3');
                    }
                  }else{
                    YBWorkTaiInfoShowVipPage.showWorkTainmishuTongVipPage(context);
                  }
                }else{
                  YBApplication.router.navigateTo(context, '/loginIn');
                }
              },
            ),
          ),
        ],
      ),
    );
  }
}
